import { defHttp } from "/@/utils/http/axios"

export const importLogType = (params, handleSuccess) => {
  return defHttp.post({ url: "/infra-service/logType/import", data: params }).then(() => {
    handleSuccess()
  })
}

export const getLogType = (params) => defHttp.get({ url: "/infra-service/logType/getType", params })
export const listLogTypeTree = (params) => defHttp.get({ url: "/infra-service/logType/listTree", params })

export const saveOrUpdateLogType = (params, isUpdate) => {
  const url = isUpdate ? "/infra-service/logType/updateType" : "/infra-service/logType/saveType"
  return defHttp.post({ url: url, params })
}

export const deleteLogType = (params, handleSuccess) => {
  return defHttp.delete({ url: "/infra-service/logType/deleteType", data: params }, { joinParamsToUrl: true }).then(() => {
    handleSuccess()
  })
}